 package contenido;

public class PlantillaFormulario {

	public PlantillaFormulario(){
		
	}

	public String Spinner(String name,String value){ 
		return "<tr>\n"+
		"<td class=\"ui-widget-header text\">"+value+"</td>\n"+ 
		"<td class=\"text ui-widget-content ui-corner-all\">" +
		"<input type=\"text\" id=\""+name+"\" size=\"10\" value=\"1\" /></td>\n"+
		"</tr>\n"; 
	}

	
	public String Field(String name,String value){ 
		return "<tr>\n"+
		"<td class=\"ui-widget-header text\">"+value+"</td>\n"+ 
		"<td class=\"text ui-widget-content ui-corner-all\"><input type=\"text\" name=\""+name+"\" id=\""+name+"\" size=\"40\" /></td>\n"+
		"</tr>\n"; 
	}
	
	public String Field(String name,String value,String size){ 
		return "<tr>"+
		"<td class=\"ui-widget-header text\">"+value+"</td>"+ 
		"<td class=\"text ui-widget-content ui-corner-all\"><input type=\"text\" name=\""+name+"\" id=\""+name+"\" size=\""+size+"\"/></td>"+
		"</tr>"; 
	}
	
	public String PasswordField(String name,String value){ 
		return "<tr>\n"+
		"<td class=\"ui-widget-header text\">"+value+"</td>\n"+ 
		"<td class=\"text ui-widget-content ui-corner-all\"><input type=\"text\" name=\""+name+"\" id=\""+name+"\" size=\"40\" /></td>\n"+
		"</tr>\n"; 
	}

	public String PasswordField(String name,String value,String size){ 
		return "<tr>"+
		"<td class=\"ui-widget-header text\">"+value+"</td>"+ 
		"<td class=\"text ui-widget-content ui-corner-all\"><input type=\"password\" name=\""+name+"\" id=\""+name+"\" size=\""+size+"\"/></td>"+
		"</tr>"; 
	}
	
	
	public String Button(String value,String href,String img){ 
		return "<td class=\"text ui-widget-content ui-corner-all centrado size200px\">" 
		+"<a href=\""+href+"\"><img  width=\"24px\"  height=\"24px\" src=\""+img+"\"/>"+value+"</a>"
		+"</td>";
	}
	
	public String Button(String value,String href,String img,String function){ 
		return "<td class=\"text ui-widget-content ui-corner-all centrado size200px\">" 
		+"<a href=\""+href+"\" onclick=\""+function+"\"><img  width=\"24px\"  height=\"24px\" src=\""+img+"\"/>"+value+"</a>"
		+"</td>";
	}
	
	public String Button(String value,String FeaturesArray[]){
		String cad="<td class=\"text ui-widget-content ui-corner-all centrado size200px\">" +
				"<a "; 
		for(String element :FeaturesArray)
			cad+=element+" ";
		cad+=">"+value+"</a></td>"; 
		return cad;
	}
	
	
	public String HeaderFields(){
		return "<table class=\"center\">";
	}
	
	//permite indicar algo del estyle
	public String HeaderFields(String style){
		return "<table class=\"center\" style=\""+style+"\">";
	}
	public String FooterFields(){
		return "</table>";
	}
}
